//
//  ZLPublicNoticeTableViewCell.m
//  ZLExamination
//
//  Created by Lei_Zhong_Xun on 2017/8/21.
//  Copyright © 2017年 Zheng. All rights reserved.
//

#import "ZLPublicNoticeTableViewCell.h"

@implementation ZLPublicNoticeTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.contentView.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:self.titleLabel];
        [self.contentView addSubview:self.timeLabel];
        [self.contentView addSubview:self.contentLabel];
    }
    return self;
}

#pragma mark - 布局
- (void)layoutSubviews
{
    [super layoutSubviews];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(10);
        make.right.equalTo(self.contentView.mas_right).offset(- 10);
        make.top.equalTo(self.contentView.mas_top).offset(15);
        make.height.equalTo(@16);
    }];
    [_timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(10);
        make.right.equalTo(self.contentView.mas_right).offset(- 10);
        make.top.equalTo(_titleLabel.mas_bottom).offset(8);
        make.height.equalTo(@13);
    }];
    [_contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(10);
        make.right.equalTo(self.contentView.mas_right).offset(- 10);
        make.top.equalTo(_timeLabel.mas_bottom).offset(15);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(- 16);
    }];
}

#pragma mark - lazy load
- (UILabel *)titleLabel
{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.font = kCX_FONT(16);
        _titleLabel.textColor = kRGB_COLOR(51, 51, 51, 1.0);
        _titleLabel.text = @"全国依法治国前景退稿司考温度";
    }
    return _titleLabel;
}
- (UILabel *)timeLabel
{
    if (!_timeLabel) {
        _timeLabel = [[UILabel alloc] init];
        _timeLabel.font = kCX_FONT(13);
        _timeLabel.textColor = kRGB_COLOR(153, 153, 153, 1.0);
        _timeLabel.text = @"2017-08-09";
    }
    return _timeLabel;
}
- (UILabel *)contentLabel
{
    if (!_contentLabel) {
        _contentLabel = [[UILabel alloc] init];
        _contentLabel.backgroundColor = [UIColor clearColor];
//        _contentLabel.text = @"全国依法治国前景退稿司考温度,全国依法治国前景退稿司考温度全国依法治国前景退稿司考温度全国依法治国前景退稿司考温度,全国依法治国前景退稿司考温度";
        _contentLabel.font = kCX_FONT(13);
        _contentLabel.textColor = kRGB_COLOR(51, 51, 51, 1.0);
        _contentLabel.numberOfLines = 0;
        [_contentLabel sizeToFit];
        
    }
    return _contentLabel;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
